%by Amr

\subsubsection{Notations and Functions}

In this subsection, we present the needed notations and function to represent a relational algebra into a spreadsheet.
First, we will use the notation of \texttt{RmCn} notation to address the cells with all of its derivation. For example,
\texttt{R1C1} denotes the cell in the first row and the first column. If a number of the two is missing then it is in the same
row and column. if \texttt{m} or \texttt{n} are between square brackets, then it is the difference between the given row (column)
and the intended row(column). For example, \texttt{R[-2]C7} indicate cell which is two rows directly above the
present one in column 7.

Moreover, we will use the function \texttt{IF(condition,true\_branch,false\_branch)}, which returns true or false according to the
condition. Furthermore, the function \texttt{SUMPRODUCT(I)} will be used to check redundancy and many more constraints.

\texttt{=SUMPRODUCT((R1C1:R5C1=R1C3)*(R1C2:R5C2=R1C4))} is calculated
that each cell in the range \texttt{R1C1:R5C1} is to be compared with \texttt{R1C3},
and this yields a sequence of five booleans
Also, each cell in the range \texttt{R1C2:R5C2} is to be compared with \texttt{R1C4},
and this yields another sequence of five booleans. After that. the two sequences from previous items are multiplied
together according to their positions, which results in automatic data type conversion
from booleans to integers, and then normal multiplication.
Then the five numbers are summed to give a single number
as a result. The final result is the count of rows, in which
the columns \texttt{C1} and \texttt{C2} contain the same pair of numbers as
in \texttt{R1C3:R1C4}.

\subsubsection{Generating the workbook}

Given a relational model, a workbook will be generated such that every spreadsheet in this workbook represents a relation.
For every relation \textit|{r} with arity \textit{n}, consecutive \textit{n} columns represent this arity
and each row is be an entry for this relation.

Data are entered into these spreadsheets.The data
table sheets do not contain any formulas and are simply
the place to enter tuples into relations. Enforcing primary keys, foreign keys and other integrity constraints included
in the relational model. We will see in the next section how we enforce most of the constraints using the functions
provided by the spreadsheet framework.

Suppose we have a Relational model consisting only of one table which is \textit{income(id, name, income)}. Then the
corresponding spread sheet will be named \texttt{income} with column \texttt{C1}
for the \textit{id}, column \texttt{C2} for the \textit{name} and column
\texttt{C3} for the \textit{income}
.